feat(stability): stream text batching, bounded file preview, CI chromium smoke, and offline terminal indicator - #5
Merged
Conversation
…dd chromium smoke to CI, and preserve offline terminal states
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
小型稳定性 PR,完成以下四项改进:
流式 text_delta 40ms 合并刷新 (Task A):
streamBatcher.ts,以 ~40ms 窗口合并来自多个 messageId 的text_delta/textSnapshot,减少 DOM 滚动抖动和高频 re-render。text_complete、run_status、错误或用户取消/发送前立即同步 flush。revision/loadSequence竞争防护,历史异步加载不会覆盖正在流入的新文本。Conversation抽取 memoMessageItem组件,稳定历史消息引用与onCopyError回调。大文件预览上限与安全截断 (Task B):
files.READ不再对超大文件无界全量读取。保留resolveSessionFilePath路径穿越与链接保护。packages/shared/src/sessions/preview.ts:使用同一打开文件句柄fstatSync/readSync/closeSync,拒绝非普通文件。<= 1MiB全量预览;> 1MiB仅读取前 256KiB;多字节 UTF-8 边界安全截断,防止伪造末尾字符 (\uFFFD);磁盘原文件完全保留。FileReadResult/FilePreviewState,并在DetailsPanel提示“文件较大,仅显示前 256 KiB”。Chromium 动效 Smoke Test 加入 CI (Task C):
scripts/verify-ui.cjs增加--web-only入口,纯 Web 流程完整覆盖verify-map-motion.cjs、verify-run-motion.cjs及大文件截断、断线终态断言,不初始化 Electron。package.json添加test:ui:web。.github/workflows/validate.yml:增加 Node setup、安装 Playwright Chromium 及系统依赖、构建后执行 web-only 动效 smoke,失败时上传 QA 产物。THREADCOVE_PROVIDER=deepseek+ 本地 mock HTTP 响应),不读取个人 Go 密钥或发真实模型请求,亦非重新验证真实 Go 接口。离线终态显示修复 (Task D):
RunIndicator在离线状态下完整保留completed、cancelled、failed、interrupted终态。Verification
bun test: 178 passed, 0 failed across 26 test files (含新增的streamBatcher.test.ts,preview.test.ts,RunIndicator.test.tsx)。bun run typecheck: 0 errors across all workspace packages。bun run lint: 0 errors。bun run build: WebUI 与 Electron 构建成功。node scripts/verify-ui.cjs --web-only: PASSED (verification.json生成,passed=true, requests=4, webOnly=true)。node scripts/verify-ui.cjs: PASSED (Web + Electron 完整运行通过,passed=true, requests=6)。